import Vue from "vue";
import Router from "vue-router";
import Home from "./views/Home.vue";

Vue.use(Router);

export default new Router({
  routes: [{
      path: "/",
      redirect: "/home"
    },
    {
      path: "/home",
      name: "home",
      component: Home
    },
    {
      path: "/kind",
      name: "kind",
      redirect:"/kind/floor1",
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () =>
        import( /* webpackChunkName: "kind" */ "./views/kind.vue"),
      children: [{
        path: "floor1",
        component: () =>
        import( /* webpackChunkName: "kindfloor1" */ "./components/floor1.vue"),
      },
      {
        path: "floor2",
        component: () =>
        import( /* webpackChunkName: "kindfloor1" */ "./components/floor2.vue"),
      },
      {
        path: "floor3",
        component: () =>
        import( /* webpackChunkName: "kindfloor1" */ "./components/floor3.vue"),
      }]
    },
    {
      path:"/shopcart",
      component: () =>
      import( /* webpackChunkName: "kindfloor1" */ "./views/shopcart.vue"),
    },
    {
      path:"/mine",
      component: () =>
      import( /* webpackChunkName: "kindfloor1" */ "./views/mine.vue"),
    }
  ]
});